
#ifndef etl_connection_base_h
#define etl_connection_base_h

#include <pthread.h>

#include "etl_socket.h"

namespace etl
{

class etl_server_socket;

class etl_connection_base
{
    friend class etl_server_socket;
public:

  etl_connection_base() : 
    thread(0), 
    running(false)
    {
      initialize();
    }

  virtual ~etl_connection_base()
    {
    }
  
  virtual etl_connection_base* clone() = 0;

  virtual int service_client() = 0;

  static int initialize();

protected:
  etl::etl_socket client_conn;
  pthread_t thread;
  bool running;
  static bool initialized;
};

}

#endif

